
#ifndef  BREAKPOINTSTATE_H
#define  BREAKPOINTSTATE_H

#include "IBreakPointState.h"

class BreakPointState  : public IBreakPointState {
public:
    BreakPointState();
    virtual ~BreakPointState();

    bool isEnd() const override;
    bool isInited() const override;
    bool isConnected() const override;
    bool isLogined() const override;
    bool isDisconnected() const override;

    // INITED, CONNECTED, LOGINED, DISCONNECTED -> END
    int toEnd(Callback beforeSwitch) override;
    // END -> INITED
    int toInited(Callback beforeSwitch) override;
    // INITED -> CONNECTED
    int toConnected(Callback beforeSwitch) override;
    // CONNECTED -> LOGINED
    int toLogined(Callback beforeSwitch) override;
    // CONNECTED, LOGINED -> DISCONNECTED
    int toDisconnected(Callback beforeSwitch) override;

    std::ostream &  log(std::ostream & out) override;

private:
    int callback(Callback beforeSwitch);

    int status;
};




#endif   /* BREAKPOINTSTATE_H */
